//
//  UITextField+Extension.swift
//  EasyDana
//
//  Created by mac on 2024/10/23.
//

import Foundation
extension UITextField {
    
    static func swizzle() {
        let originalSelector = #selector(UITextField.init(coder:))
        let swizzledSelector = #selector(UITextField.my_init(coder:))
        let originalMethod = class_getInstanceMethod(UITextField.self, originalSelector)!
        let swizzledMethod = class_getInstanceMethod(UITextField.self, swizzledSelector)!
        method_exchangeImplementations(originalMethod, swizzledMethod)
    }
    
    @objc func my_init(coder: NSCoder) -> UITextField {
        let label = my_init(coder: coder)
        label.text = label.text?.locale
        label.placeholder = label.placeholder?.locale
        return label
    }
}
